package com.rupertjones.globalcron.domain;


import com.rupertjones.globalcron.AbstractBuilder;

/**
 * <p>&copy Rupert Jones 2012</p>
 *
 * @author rup
 */
public class JobDescriptorBuilder extends AbstractBuilder<JobDescriptor> {
    public JobDescriptorBuilder() {
        super(new JobDescriptor());
        HostBuilder hostBuilder = new HostBuilder();
        entity.setName("name");
        entity.setEnabled(true);
        entity.setAllowAdhocExec(true);
        entity.setCron("cron");
        entity.setHost(hostBuilder.build());
        entity.setLastModified(1l);
        entity.setSaveOutput(true);
        entity.setScript("script");
        entity.setTimezone("Australia/Victoria");
        entity.setVersion(0);
        entity.setWaitForCompletion(true);
    }

    public JobDescriptorBuilder withName(String name) {
        entity.setName(name);
        return this;
    }

    public JobDescriptorBuilder withHost(Host host) {
        entity.setHost(host);
        return this;
    }
}
